/*********************************************************************
*                                                                    *
*                SEGGER Microcontroller GmbH & Co. KG                *
*        Solutions for real time microcontroller applications        *
*                                                                    *
**********************************************************************
*                                                                    *
* C-file generated by:                                               *
*                                                                    *
*        GUI_Builder for emWin version 5.32                          *
*        Compiled Oct  8 2015, 11:59:02                              *
*        (c) 2015 Segger Microcontroller GmbH & Co. KG               *
*                                                                    *
**********************************************************************
*                                                                    *
*        Internet: www.segger.com  Support: support@segger.com       *
*                                                                    *
**********************************************************************
*/

// USER START (Optionally insert additional includes)
// USER END

#include "DIALOG.h"

/*********************************************************************
*
*       Defines
*
**********************************************************************
*/
#define ID_WINDOW_0    (GUI_ID_USER + 0x01)
#define ID_BUTTON_0    (GUI_ID_USER + 0x03)
#define ID_BUTTON_1    (GUI_ID_USER + 0x04)
#define ID_BUTTON_2    (GUI_ID_USER + 0x05)


#define FlUO_BUTTON_ID     ID_BUTTON_0
#define WHITE_BUTTON_ID    ID_BUTTON_1
#define STBY_BUTTON_ID     ID_BUTTON_2


static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
  { WINDOW_CreateIndirect, "BtnWindow", ID_WINDOW_0, 8, 100, 1008, 490, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "FluoButton", FlUO_BUTTON_ID, 20, 25, 290, 290, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "whiteButton", WHITE_BUTTON_ID, 335, 15, 330, 300, 0, 0x0, 0 },
  { BUTTON_CreateIndirect, "StbyButton", STBY_BUTTON_ID, 690, 25, 290, 290, 0, 0x0, 0 },
  // USER START (Optionally insert additional widgets)
  // USER END
};

void _cbFluoButton1024x600(WM_MESSAGE * pMsg);
void _cbWhiteButton1024x600(WM_MESSAGE * pMsg);
void _cbStandbyButton1024x600(WM_MESSAGE * pMsg);

WM_HWIN CreateStandbyWindow1024x600(WM_HWIN parent);
/*********************************************************************
*
*       _cbDialog
*/
static void _cbDialog(WM_MESSAGE * pMsg) {
  WM_HWIN hItem;
  int     NCode;
  int     Id;

   WM_HWIN hStandbyWindow;
  // USER START (Optionally insert additional variables)
  // USER END

  switch (pMsg->MsgId) {
  case WM_INIT_DIALOG:
    //
    // Initialization of 'BtnWindow'
    //
    hItem = pMsg->hWin;
    WINDOW_SetBkColor(hItem, GUI_MAKE_COLOR(0x00272727));

	hItem = WM_GetDialogItem(pMsg->hWin, FlUO_BUTTON_ID);          
    WM_SetCallback(hItem, _cbFluoButton1024x600);  
	
	hItem = WM_GetDialogItem(pMsg->hWin, WHITE_BUTTON_ID);            
    WM_SetCallback(hItem, _cbWhiteButton1024x600);  
 
    hItem = WM_GetDialogItem(pMsg->hWin, STBY_BUTTON_ID);         
    WM_SetCallback(hItem, _cbStandbyButton1024x600); 

    break;
  case WM_NOTIFY_PARENT:
    Id    = WM_GetId(pMsg->hWinSrc);
    NCode = pMsg->Data.v;
    switch(Id) {
    case FlUO_BUTTON_ID: // Notifications sent by 'FluoButton'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case WHITE_BUTTON_ID: // Notifications sent by 'whiteButton'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case STBY_BUTTON_ID: 
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
		CreateStandbyWindow1024x600(WM_HBKWIN);
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    // USER START (Optionally insert additional code for further Ids)
    // USER END
    }
    break;
  // USER START (Optionally insert additional message handling)
  // USER END
  default:
    WM_DefaultProc(pMsg);
    break;
  }
}

/*********************************************************************
*
*       Public code
*
**********************************************************************
*/
/*********************************************************************
*
*       CreateBtnWindow
*/
WM_HWIN CreateBtnWindow1024x600(WM_HWIN parent);
WM_HWIN CreateBtnWindow1024x600(WM_HWIN parent) {
  WM_HWIN hWin;

  hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, parent, 0, 0);   //WM_HBKWIN
  return hWin;
}

// USER START (Optionally insert additional public code)
// USER END

/*************************** End of file ****************************/
